{===============================================================================

Copyright (c) 2010 P.L. Polak

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


===============================================================================}

{ Logic to detect the used Delphi compiler version: }
{$IFDEF VER120}
  {$DEFINE DMB_DELPHI1}
  {$DEFINE DMB_DELPHI2}
  {$DEFINE DMB_DELPHI3}
  {$DEFINE DMB_DELPHI4}
  {$DEFINE DMB_DELPHI4_ONLY}
{$ENDIF}
{$IFDEF VER130}
  {$DEFINE DMB_DELPHI1}
  {$DEFINE DMB_DELPHI2}
  {$DEFINE DMB_DELPHI3}
  {$DEFINE DMB_DELPHI4}
  {$DEFINE DMB_DELPHI5}
  {$DEFINE DMB_DELPHI5_ONLY}
{$ENDIF}
{$IFDEF VER140}
  {$DEFINE DMB_DELPHI1}
  {$DEFINE DMB_DELPHI2}
  {$DEFINE DMB_DELPHI3}
  {$DEFINE DMB_DELPHI4}
  {$DEFINE DMB_DELPHI5}
  {$DEFINE DMB_DELPHI6}
  {$DEFINE DMB_DELPHI6_ONLY}
{$ENDIF}
{$IFDEF VER150}
  {$DEFINE DMB_DELPHI1}
  {$DEFINE DMB_DELPHI2}
  {$DEFINE DMB_DELPHI3}
  {$DEFINE DMB_DELPHI4}
  {$DEFINE DMB_DELPHI5}
  {$DEFINE DMB_DELPHI6}
  {$DEFINE DMB_DELPHI7}
  {$DEFINE DMB_DELPHI7_ONLY}
{$ENDIF}
{$IFDEF VER170}
  {$DEFINE DMB_DELPHI1}
  {$DEFINE DMB_DELPHI2}
  {$DEFINE DMB_DELPHI3}
  {$DEFINE DMB_DELPHI4}
  {$DEFINE DMB_DELPHI5}
  {$DEFINE DMB_DELPHI6}
  {$DEFINE DMB_DELPHI7}
  {$DEFINE DMB_DELPHI2005}
  {$DEFINE DMB_DELPHI2005_ONLY}
{$ENDIF}
{$IFDEF VER180}
  {$DEFINE DMB_DELPHI1}
  {$DEFINE DMB_DELPHI2}
  {$DEFINE DMB_DELPHI3}
  {$DEFINE DMB_DELPHI4}
  {$DEFINE DMB_DELPHI5}
  {$DEFINE DMB_DELPHI6}
  {$DEFINE DMB_DELPHI7}
  {$DEFINE DMB_DELPHI2005}
  {$DEFINE DMB_DELPHI2006}
  {$IFNDEF VER185}
    {$DEFINE DMB_DELPHI2006_ONLY}
  {$ENDIF}
{$ENDIF}
{$IFDEF VER185}
  {$DEFINE DMB_DELPHI1}
  {$DEFINE DMB_DELPHI2}
  {$DEFINE DMB_DELPHI3}
  {$DEFINE DMB_DELPHI4}
  {$DEFINE DMB_DELPHI5}
  {$DEFINE DMB_DELPHI6}
  {$DEFINE DMB_DELPHI7}
  {$DEFINE DMB_DELPHI2005}
  {$DEFINE DMB_DELPHI2006}
  {$DEFINE DMB_DELPHI2007}
  {$DEFINE DMB_DELPHI2007_ONLY}
{$ENDIF}
{$IFDEF VER200}
  {$DEFINE DMB_DELPHI1}
  {$DEFINE DMB_DELPHI2}
  {$DEFINE DMB_DELPHI3}
  {$DEFINE DMB_DELPHI4}
  {$DEFINE DMB_DELPHI5}
  {$DEFINE DMB_DELPHI6}
  {$DEFINE DMB_DELPHI7}
  {$DEFINE DMB_DELPHI2005}
  {$DEFINE DMB_DELPHI2006}
  {$DEFINE DMB_DELPHI2007}
  {$DEFINE DMB_DELPHI2009}
  {$DEFINE DMB_DELPHI2009_ONLY}
{$ENDIF}
{$IFDEF VER210}
  {$DEFINE DMB_DELPHI1}
  {$DEFINE DMB_DELPHI2}
  {$DEFINE DMB_DELPHI3}
  {$DEFINE DMB_DELPHI4}
  {$DEFINE DMB_DELPHI5}
  {$DEFINE DMB_DELPHI6}
  {$DEFINE DMB_DELPHI7}
  {$DEFINE DMB_DELPHI2005}
  {$DEFINE DMB_DELPHI2006}
  {$DEFINE DMB_DELPHI2007}
  {$DEFINE DMB_DELPHI2009}
  {$DEFINE DMB_DELPHI2010}
  {$DEFINE DMB_DELPHI2010_ONLY}
{$ENDIF}
{$IFDEF VER220}
  {$DEFINE DMB_DELPHI1}
  {$DEFINE DMB_DELPHI2}
  {$DEFINE DMB_DELPHI3}
  {$DEFINE DMB_DELPHI4}
  {$DEFINE DMB_DELPHI5}
  {$DEFINE DMB_DELPHI6}
  {$DEFINE DMB_DELPHI7}
  {$DEFINE DMB_DELPHI2005}
  {$DEFINE DMB_DELPHI2006}
  {$DEFINE DMB_DELPHI2007}
  {$DEFINE DMB_DELPHI2009}
  {$DEFINE DMB_DELPHI2010}
  {$DEFINE DMB_DELPHIXE}
  {$DEFINE DMB_DELPHIXE_ONLY}
{$ENDIF}
{$IFDEF VER230}
  {$DEFINE DMB_DELPHI1}
  {$DEFINE DMB_DELPHI2}
  {$DEFINE DMB_DELPHI3}
  {$DEFINE DMB_DELPHI4}
  {$DEFINE DMB_DELPHI5}
  {$DEFINE DMB_DELPHI6}
  {$DEFINE DMB_DELPHI7}
  {$DEFINE DMB_DELPHI2005}
  {$DEFINE DMB_DELPHI2006}
  {$DEFINE DMB_DELPHI2007}
  {$DEFINE DMB_DELPHI2009}
  {$DEFINE DMB_DELPHI2010}
  {$DEFINE DMB_DELPHIXE}
  {$DEFINE DMB_DELPHIXE2}
  {$DEFINE DMB_DELPHIXE2_ONLY}
{$ENDIF}
{$IFDEF VER240}
  {$DEFINE DMB_DELPHI1}
  {$DEFINE DMB_DELPHI2}
  {$DEFINE DMB_DELPHI3}
  {$DEFINE DMB_DELPHI4}
  {$DEFINE DMB_DELPHI5}
  {$DEFINE DMB_DELPHI6}
  {$DEFINE DMB_DELPHI7}
  {$DEFINE DMB_DELPHI2005}
  {$DEFINE DMB_DELPHI2006}
  {$DEFINE DMB_DELPHI2007}
  {$DEFINE DMB_DELPHI2009}
  {$DEFINE DMB_DELPHI2010}
  {$DEFINE DMB_DELPHIXE}
  {$DEFINE DMB_DELPHIXE2}
  {$DEFINE DMB_DELPHIXE3}
  {$DEFINE DMB_DELPHIXE3_ONLY}
{$ENDIF}
{$IFDEF VER250}
  {$DEFINE DMB_DELPHI1}
  {$DEFINE DMB_DELPHI2}
  {$DEFINE DMB_DELPHI3}
  {$DEFINE DMB_DELPHI4}
  {$DEFINE DMB_DELPHI5}
  {$DEFINE DMB_DELPHI6}
  {$DEFINE DMB_DELPHI7}
  {$DEFINE DMB_DELPHI2005}
  {$DEFINE DMB_DELPHI2006}
  {$DEFINE DMB_DELPHI2007}
  {$DEFINE DMB_DELPHI2009}
  {$DEFINE DMB_DELPHI2010}
  {$DEFINE DMB_DELPHIXE}
  {$DEFINE DMB_DELPHIXE2}
  {$DEFINE DMB_DELPHIXE3}
  {$DEFINE DMB_DELPHIXE4}
  {$DEFINE DMB_DELPHIXE4_ONLY}
{$ENDIF}
{$IFDEF VER260}
  {$DEFINE DMB_DELPHI1}
  {$DEFINE DMB_DELPHI2}
  {$DEFINE DMB_DELPHI3}
  {$DEFINE DMB_DELPHI4}
  {$DEFINE DMB_DELPHI5}
  {$DEFINE DMB_DELPHI6}
  {$DEFINE DMB_DELPHI7}
  {$DEFINE DMB_DELPHI2005}
  {$DEFINE DMB_DELPHI2006}
  {$DEFINE DMB_DELPHI2007}
  {$DEFINE DMB_DELPHI2009}
  {$DEFINE DMB_DELPHI2010}
  {$DEFINE DMB_DELPHIXE}
  {$DEFINE DMB_DELPHIXE2}
  {$DEFINE DMB_DELPHIXE3}
  {$DEFINE DMB_DELPHIXE4}
  {$DEFINE DMB_DELPHIXE5}
  {$DEFINE DMB_DELPHIXE5_ONLY}
{$ENDIF}
{$IFDEF VER270}
  {$DEFINE DMB_DELPHI1}
  {$DEFINE DMB_DELPHI2}
  {$DEFINE DMB_DELPHI3}
  {$DEFINE DMB_DELPHI4}
  {$DEFINE DMB_DELPHI5}
  {$DEFINE DMB_DELPHI6}
  {$DEFINE DMB_DELPHI7}
  {$DEFINE DMB_DELPHI2005}
  {$DEFINE DMB_DELPHI2006}
  {$DEFINE DMB_DELPHI2007}
  {$DEFINE DMB_DELPHI2009}
  {$DEFINE DMB_DELPHI2010}
  {$DEFINE DMB_DELPHIXE}
  {$DEFINE DMB_DELPHIXE2}
  {$DEFINE DMB_DELPHIXE3}
  {$DEFINE DMB_DELPHIXE4}
  {$DEFINE DMB_DELPHIXE5}
  {$DEFINE DMB_DELPHIXE6}
  {$DEFINE DMB_DELPHIXE6_ONLY}
{$ENDIF}
{$IFDEF VER280}
  {$DEFINE DMB_DELPHI1}
  {$DEFINE DMB_DELPHI2}
  {$DEFINE DMB_DELPHI3}
  {$DEFINE DMB_DELPHI4}
  {$DEFINE DMB_DELPHI5}
  {$DEFINE DMB_DELPHI6}
  {$DEFINE DMB_DELPHI7}
  {$DEFINE DMB_DELPHI2005}
  {$DEFINE DMB_DELPHI2006}
  {$DEFINE DMB_DELPHI2007}
  {$DEFINE DMB_DELPHI2009}
  {$DEFINE DMB_DELPHI2010}
  {$DEFINE DMB_DELPHIXE}
  {$DEFINE DMB_DELPHIXE2}
  {$DEFINE DMB_DELPHIXE3}
  {$DEFINE DMB_DELPHIXE4}
  {$DEFINE DMB_DELPHIXE5}
  {$DEFINE DMB_DELPHIXE6}
  {$DEFINE DMB_DELPHIXE7}
  {$DEFINE DMB_DELPHIXE7_ONLY}
{$ENDIF}
{$IFDEF VER290}
  {$DEFINE DMB_DELPHI1}
  {$DEFINE DMB_DELPHI2}
  {$DEFINE DMB_DELPHI3}
  {$DEFINE DMB_DELPHI4}
  {$DEFINE DMB_DELPHI5}
  {$DEFINE DMB_DELPHI6}
  {$DEFINE DMB_DELPHI7}
  {$DEFINE DMB_DELPHI2005}
  {$DEFINE DMB_DELPHI2006}
  {$DEFINE DMB_DELPHI2007}
  {$DEFINE DMB_DELPHI2009}
  {$DEFINE DMB_DELPHI2010}
  {$DEFINE DMB_DELPHIXE}
  {$DEFINE DMB_DELPHIXE2}
  {$DEFINE DMB_DELPHIXE3}
  {$DEFINE DMB_DELPHIXE4}
  {$DEFINE DMB_DELPHIXE5}
  {$DEFINE DMB_DELPHIXE6}
  {$DEFINE DMB_DELPHIXE7}
  {$DEFINE DMB_DELPHIXE8}
  {$DEFINE DMB_DELPHIXE8_ONLY}
{$ENDIF}
{$IFDEF VER300}
  {$DEFINE DMB_DELPHI1}
  {$DEFINE DMB_DELPHI2}
  {$DEFINE DMB_DELPHI3}
  {$DEFINE DMB_DELPHI4}
  {$DEFINE DMB_DELPHI5}
  {$DEFINE DMB_DELPHI6}
  {$DEFINE DMB_DELPHI7}
  {$DEFINE DMB_DELPHI2005}
  {$DEFINE DMB_DELPHI2006}
  {$DEFINE DMB_DELPHI2007}
  {$DEFINE DMB_DELPHI2009}
  {$DEFINE DMB_DELPHI2010}
  {$DEFINE DMB_DELPHIXE}
  {$DEFINE DMB_DELPHIXE2}
  {$DEFINE DMB_DELPHIXE3}
  {$DEFINE DMB_DELPHIXE4}
  {$DEFINE DMB_DELPHIXE5}
  {$DEFINE DMB_DELPHIXE6}
  {$DEFINE DMB_DELPHIXE7}
  {$DEFINE DMB_DELPHIXE8}
  {$DEFINE DMB_DELPHI10_SEATTLE}
  {$DEFINE DMB_DELPHI10_SEATTLE_ONLY}
{$ENDIF}
{$IFDEF VER310}
  {$DEFINE DMB_DELPHI1}
  {$DEFINE DMB_DELPHI2}
  {$DEFINE DMB_DELPHI3}
  {$DEFINE DMB_DELPHI4}
  {$DEFINE DMB_DELPHI5}
  {$DEFINE DMB_DELPHI6}
  {$DEFINE DMB_DELPHI7}
  {$DEFINE DMB_DELPHI2005}
  {$DEFINE DMB_DELPHI2006}
  {$DEFINE DMB_DELPHI2007}
  {$DEFINE DMB_DELPHI2009}
  {$DEFINE DMB_DELPHI2010}
  {$DEFINE DMB_DELPHIXE}
  {$DEFINE DMB_DELPHIXE2}
  {$DEFINE DMB_DELPHIXE3}
  {$DEFINE DMB_DELPHIXE4}
  {$DEFINE DMB_DELPHIXE5}
  {$DEFINE DMB_DELPHIXE6}
  {$DEFINE DMB_DELPHIXE7}
  {$DEFINE DMB_DELPHIXE8}
  {$DEFINE DMB_DELPHI10_SEATTLE}
  {$DEFINE DMB_DELPHI10_1_BERLIN}
  {$DEFINE DMB_DELPHI10_1_BERLIN_ONLY}
{$ENDIF}

{$IFDEF VER320}
  {$DEFINE DMB_DELPHI1}
  {$DEFINE DMB_DELPHI2}
  {$DEFINE DMB_DELPHI3}
  {$DEFINE DMB_DELPHI4}
  {$DEFINE DMB_DELPHI5}
  {$DEFINE DMB_DELPHI6}
  {$DEFINE DMB_DELPHI7}
  {$DEFINE DMB_DELPHI2005}
  {$DEFINE DMB_DELPHI2006}
  {$DEFINE DMB_DELPHI2007}
  {$DEFINE DMB_DELPHI2009}
  {$DEFINE DMB_DELPHI2010}
  {$DEFINE DMB_DELPHIXE}
  {$DEFINE DMB_DELPHIXE2}
  {$DEFINE DMB_DELPHIXE3}
  {$DEFINE DMB_DELPHIXE4}
  {$DEFINE DMB_DELPHIXE5}
  {$DEFINE DMB_DELPHIXE6}
  {$DEFINE DMB_DELPHIXE7}
  {$DEFINE DMB_DELPHIXE8}
  {$DEFINE DMB_DELPHI10_SEATTLE}
  {$DEFINE DMB_DELPHI10_1_BERLIN}
  {$DEFINE DMB_DELPHI10_2_TOKYO}
  {$DEFINE DMB_DELPHI10_2_TOKYO_ONLY}
{$ENDIF}

{$IFDEF VER330}
  {$DEFINE DMB_DELPHI1}
  {$DEFINE DMB_DELPHI2}
  {$DEFINE DMB_DELPHI3}
  {$DEFINE DMB_DELPHI4}
  {$DEFINE DMB_DELPHI5}
  {$DEFINE DMB_DELPHI6}
  {$DEFINE DMB_DELPHI7}
  {$DEFINE DMB_DELPHI2005}
  {$DEFINE DMB_DELPHI2006}
  {$DEFINE DMB_DELPHI2007}
  {$DEFINE DMB_DELPHI2009}
  {$DEFINE DMB_DELPHI2010}
  {$DEFINE DMB_DELPHIXE}
  {$DEFINE DMB_DELPHIXE2}
  {$DEFINE DMB_DELPHIXE3}
  {$DEFINE DMB_DELPHIXE4}
  {$DEFINE DMB_DELPHIXE5}
  {$DEFINE DMB_DELPHIXE6}
  {$DEFINE DMB_DELPHIXE7}
  {$DEFINE DMB_DELPHIXE8}
  {$DEFINE DMB_DELPHI10_SEATTLE}
  {$DEFINE DMB_DELPHI10_1_BERLIN}
  {$DEFINE DMB_DELPHI10_2_TOKYO}
  {$DEFINE DMB_DELPHI10_3_RIO}
  {$DEFINE DMB_DELPHI10_3_RIO_ONLY}
{$ENDIF}

{$IFDEF DMB_DELPHI2005}
{ By default use Indy 10 starting from Delphi 2005 }
  {$DEFINE DMB_INDY10}
{$ELSE}
{ Older Delphi versions use Indy 9 }
  {$DEFINE DMB_INDY9}
{$ENDIF}
  
{$IFDEF FPC}
{ Force the Free Pascal Compiler in Delphi mode, and use Indy 10 }
  {$MODE DELPHI}
  {$UNDEF DMB_INDY9}
  {$DEFINE DMB_INDY10}
{$ENDIF}

{ Allow user defines to overrule the Indy version being used }
{$IFDEF FORCE_INDY9}
  {$UNDEF DMB_INDY10}
  {$DEFINE DMB_INDY9}
{$ELSE}
  {$IFDEF FORCE_INDY10}
    {$UNDEF DMB_INDY9}
    {$DEFINE DMB_INDY10}
  {$ENDIF}
{$ENDIF}
